<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        /**
         *  resolve then  ==> 触发之后结果是Promise 状态fulfilled
         *  reject then  ==> 触发之后结果是Promise 状态fulfilled
         */
        var p = Promise.resolve(10);
        var r = Promise.reject(20);
        var result = p.then(res => {
            console.log(res);
        })
        var result2 = r.catch(res => {
            console.log(res);
        })
        console.log(result);
        console.log(result2);
    </script>
</body>

</html>